﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace CMD.BAL.CAT
{
   public class Sepomex
    {
        public static DataTable GetCodigoPostal()
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_CAT_SEL_SEPOMEX_CODPOST");
            return dt;
        }
        public static DataTable  GetColonia(string idCodigoPostal)
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_CAT_SEL_SEPOMEX_COLONIA'" + idCodigoPostal +"'");
            return dt;
        }
        public static DataTable  GetEstado(String idCodigoPostal) 
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_CAT_SEL_SEPOMEX_ESTADO '" + idCodigoPostal + "'");
            return dt;
        }
        public static DataTable GetMunicipio(string idCodigoPostal)
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_CAT_SEL_SEPOMEX_DELMUN'" + idCodigoPostal + "'");
            return dt;
        }
       //SP_CMD_CAT_SEL_SEPOMEX_CODPOST_TEMP
        public static DataTable GetCodigoPostalUnid(string idCodigoPostal, string idColonia)
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_CAT_SEL_SEPOMEX_CODPOST_UNID @cod_postal='" + idCodigoPostal + "', @cod_col='"+ idColonia + "'");
            return dt;
        }

        public static DataTable getEstadoMunicipio(string idCodigoPostal)
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_SEL_SEPOMEX_CP_DM_E '" + idCodigoPostal + "'");
            return dt;
        }

        public static DataTable getLocalidad(string idEstado,string idMunicipio)
        {
            DataTable dt;
            //ejecutar store
            dt = CMD_DKT.DAL.SrvDB.ExecuteQuery("exec SP_CMD_GET_LOCALIDAD @ID_ESTADO='" + idEstado + "', @ID_MUNICIPIO='" + idMunicipio + "'");
            return dt;
        }
    }
}
